package cn.momoky.ccool.exception;


import cn.momoky.ccool.utils.ResultStatus;

public class GlobalException extends RuntimeException {

    private final Integer code;

    public GlobalException(String message) {
        super(message);
        this.code = 500;
    }

    public GlobalException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public GlobalException(ResultStatus resultStatus){
        super(resultStatus.getMsg());
        this.code = resultStatus.getCode();
    }

    public Integer getCode() {
        return code;
    }
}
